---
page_title: "cloudflare_web_analytics_rule Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a Cloudflare Web Analytics Rule resource.
---

# cloudflare_web_analytics_rule (Resource)

Provides a Cloudflare Web Analytics Rule resource.

## Example Usage

```terraform
resource "cloudflare_web_analytics_site" "example" {
  account_id   = "f037e56e89293a057740de681ac9abbe"
  zone_tag     = "0da42c8d2132a9ddaf714f9e7c920711"
  auto_install = true
}

resource "cloudflare_web_analytics_rule" "example" {
  depends_on = [cloudflare_web_analytics_site.example]
  account_id = "f037e56e89293a057740de681ac9abbe"
  ruleset_id = cloudflare_web_analytics_site.example.ruleset_id
  host       = "*"
  paths      = ["/excluded"]
  inclusive  = false
  is_paused  = false
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `account_id` (String) The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
- `host` (String) The host to apply the rule to.
- `inclusive` (Boolean) Whether the rule includes or excludes the matched traffic from being measured in Web Analytics.
- `is_paused` (Boolean) Whether the rule is paused or not.
- `paths` (List of String) A list of paths to apply the rule to.
- `ruleset_id` (String) The Web Analytics ruleset id. **Modifying this attribute will force creation of a new resource.**

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_web_analytics_rule.example <account_id>/<ruleset_id>/<rule_id>
```
